'use strict'

//获取功能的图片
class useapps{

    constructor (mdb) {
        this.db = mdb
    }

    async get(id,type){
        let sql =  `select * from ${id}_${type}`
        let r = await this.db.query(sql);
        let data = r.rows;
        return data.map((item)=>{
            return{    
                ...item,image:`/static/image/${id}/${item.image}`
            }
        })

    }
}

module.exports = useapps